import { Player } from "../core/Player"
import Utils from "../GameUtils"
import { 灵阵, 阵法 } from "../evolution/灵阵"
import { BaseHandler } from "./BaseHandler"

export class 灵阵Handler extends BaseHandler{

    灵阵_迷雾森林(data:any,player:Player) {
        let startPoint = this.gameMgr.map_point.get(data.start)
        let endPoint = this.gameMgr.map_point.get(data.end)
        let big = startPoint.big as 灵阵
        big.布阵(阵法.迷雾森林, endPoint)
        this.gameMgr.sendBroadcast(Utils.getObj("灵阵_布阵", {"start":data.start, "end":data.end, "type":阵法.迷雾森林}))
        let big_start = startPoint.big
        big_start.actionOnce()
    }

    灵阵_佛法慈悲(data:any,player:Player) {
        let startPoint = this.gameMgr.map_point.get(data.start)
        let endPoint = this.gameMgr.map_point.get(data.end)
        let big = startPoint.big as 灵阵
        big.布阵(阵法.佛法慈悲, endPoint)
        this.gameMgr.sendBroadcast(Utils.getObj("灵阵_布阵", {"start":data.start, "end":data.end, "type":阵法.佛法慈悲}))
        let big_start = startPoint.big
        big_start.actionOnce()
    }

    灵阵_九曲黄河(data:any,player:Player) {
        let startPoint = this.gameMgr.map_point.get(data.start)
        let endPoint = this.gameMgr.map_point.get(data.end)
        let big = startPoint.big as 灵阵
        big.布阵(阵法.九曲黄河, endPoint)
        this.gameMgr.sendBroadcast(Utils.getObj("灵阵_布阵", {"start":data.start, "end":data.end, "type":阵法.九曲黄河}))
        let big_start = startPoint.big
        big_start.actionOnce()
    }

    灵阵_地狱杀伐(data:any,player:Player) {
        let startPoint = this.gameMgr.map_point.get(data.start)
        let endPoint = this.gameMgr.map_point.get(data.end)
        let big = startPoint.big as 灵阵
        big.布阵(阵法.地狱杀伐, endPoint)
        this.gameMgr.sendBroadcast(Utils.getObj("灵阵_布阵" ,{"start":data.start, "end":data.end, "type":阵法.地狱杀伐}))
        let big_start = startPoint.big
        big_start.actionOnce()
    }
   
}